import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Button } from 'antd'
// import { Import } from 'HOC'
import { API_POST_PRODUCT_CENTER_GOODS_PROCESSING_IMPORT } from 'ApiMapper'
import style from '../style/Tool.scss'

export default class App extends Component {
  constructor() {
    super()
    this.state = {}
  }

  render() {
    const {
      showAddPage,
      showDeletePopUp,
      handleDownLoad,
      handleExport,
      handleImportSuccess,
      handleExprotError,
    } = this.props
    return (
      <section className={style.orderCenter_tool}>
        <Button className={style.btn} type="primary" onClick={showAddPage}>
          新增
        </Button>
        <Button className={style.btn} type="primary" onClick={showDeletePopUp}>
          删除
        </Button>
        <Button className={style.btn} type="primary" onClick={handleDownLoad}>
          下载模版
        </Button>
        {/* <Import
          action={{ api: API_POST_PRODUCT_CENTER_GOODS_PROCESSING_IMPORT }}
          onOk={handleImportSuccess}
          onExprotError={handleExprotError}
        >
          <Button className={style.btn} type="primary">
            导入数据
          </Button>
        </Import> */}
        <Button className={style.btn} type="primary" onClick={handleExport}>
          导出数据
        </Button>
      </section>
    )
  }
}

App.propTypes = {
  showAddPage: PropTypes.func.isRequired,
  showDeletePopUp: PropTypes.func.isRequired,
  handleDownLoad: PropTypes.func.isRequired,
  handleExport: PropTypes.func.isRequired,
  handleImportSuccess: PropTypes.func.isRequired,
  handleExprotError: PropTypes.func.isRequired,
}
